package com.itheima.sh.p_inner_class1;

public class Outer {
    private int age = 99;
    public static String a;

    //成员内部类
    public class Inner {
        //可以定义成员变量
        private String name;
        private int age = 88;
        public static String schoolName;//JDK 16 开始才支持静态成员变量

        //可以定义普通方法
        public void test() {
            System.out.println(age);
            System.out.println(a);

            int age = 66;
            System.out.println(age);//66
            System.out.println(this.age);//88
            System.out.println(Outer.this.age);//99
        }
        //可以定义set、get方法

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
